package day04;

import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;


public class CollectionIterator {
    Scanner scanner;

    public static void main(String[] args) {
        List<Integer> list = new LinkedList<>();
        for (int i = 0; i < 10000000; i++) {
            list.add(i);
        }
        long start = System.currentTimeMillis();
        // System.out.println(list);
//        Iterator<Integer> it=list.iterator();
//        while(it.hasNext()){
//            System.out.println(it.next());
//        }
        for (int i = 0; i < list.size(); i++) {
            list.get(i);
        }
        long end = System.currentTimeMillis();
        System.out.println((end - start) / 1000.0);
//        for(Integer num:list){
//            System.out.println(num);
//        }
    }
}